package com.xypower.service.Impl;

import com.xypower.mapper.BlockInfoMapper;
import com.xypower.mapper.SentInfoMapper;
import com.xypower.pojo.BlockInfo;
import com.xypower.pojo.SentInfo;
import com.xypower.service.SentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Time;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * 类名:
 * 作者:XY
 * 创建时间:2021/11/15-0:17
 * 功能:
 */
@Service
public class SentInfoServiceImpl implements SentInfoService {
    @Autowired
    private SentInfoMapper sentInfoMapper;
    @Autowired
    private BlockInfoMapper blockInfoMapper;
    @Override
    public List<SentInfo> getAll() {
        List<SentInfo> sentInfos = sentInfoMapper.selectAll();
        for (SentInfo sentInfo:sentInfos){
            sentInfo.setPublisherName(blockInfoMapper.selectByPrimaryKey(sentInfo.getPubId()).getPublisherName());
        }
        System.out.println(sentInfos);
        return sentInfos;
    }
}
